<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/12/29
 * Time: 16:46
 */
namespace common\models\Service;

use common\models\Cache;
use common\models\DAO\PostalLqk;
use common\models\CommonFunction;

class PostalLqkService{

    public function ApplyLqk(){
        $return = ['status'=>0];
        $postal = new PostalLqk();
        $postal->username = $_POST['username'];
        $postal->id_no = CommonFunction::encrypt($_POST['id_no']);
        $postal->phone = CommonFunction::encrypt($_POST['phone']);
        $postal->friend_name = $_POST['friend_name'];
        $postal->friend_phone = CommonFunction::encrypt($_POST['friend_phone']);
        $postal->save() && $return = ['status'=>1];
        return json_encode($return);
    }

    public function InformationLqk(){
        $return = ['status'=>0];
        $postal = new PostalLqk();
        $postal->friend_name = $_POST['friend_name'];
        $postal->friend_no = CommonFunction::encrypt($_POST['friend_no']);
        $postal->friend_card = CommonFunction::encrypt($_POST['friend_card']);
        $postal->friend_phone = CommonFunction::encrypt($_POST['friend_phone']);
        $postal->save() && $return = ['status'=>1];
        return json_encode($return);
    }
}